You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print the embedded CLI version without trying to resolve version as an API hostname
keep root help, unknown-command behavior, and the embedded skill unchanged
Test methods
Automated validation run on this branch:
go test ./...
go vet ./...
Manual validation:
go build -o /tmp/dci-pr36 .
/tmp/dci-pr36 version
/tmp/dci-pr36 --version
/tmp/dci-pr36 --help
version and --version should print the same local version without making a network request. Root help should retain the existing complete command behavior.
Could this break things?
Risk: low. This only reserves version as a local command, matching the already-supported --version behavior. API commands, root help, unknown-command handling, and the embedded agent skill are unchanged. Only an unusual workflow that intentionally used version as an API host token would behave differently.
Reviewed at 0a141f8. Built the branch and tested against the live API.
This looks good to merge. Dropping the help rewrite was the right call — it's now +28/-0 across two files, one focused change.
Confirmed the bug is real on main:
$ ./dci-main version
ERROR: Caught error: Get "https://version?customerContext=<active-context>": dial tcp: lookup version: no such host
EXIT=1
Worth noting for the changelog: this wasn't only a failed lookup — main also appended the active customer context as a query param to that arbitrary host. Good thing to have closed.
Verified on the branch: dci version → dev, exit 0, no network. Root help is unchanged (257 lines vs 256 on main), go build/vet/test all clean.
Two non-blocking notes:
Two formats for one fact.dci version prints dev while dci --version prints <binary> version dev. Worth picking one. Also registerVersionCommand writes to os.Stdout directly where the surrounding registrations use cmd.OutOrStdout()/cli.Stdout.
This is a point fix, not the root cause. The underlying hole is main.go:381's exemption list combined with restish's generic root Run treating args[0] as a hostname. Still open after this PR: dci "" → Get "https:?customerContext=<ctx>", exit 1. Overriding cli.Root.Args/Run in lockToDCI() would close the whole class. Fine as a follow-up — not a reason to hold this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dci versiona first-class local commandversionas an API hostnameTest methods
Automated validation run on this branch:
go test ./... go vet ./...Manual validation:
go build -o /tmp/dci-pr36 . /tmp/dci-pr36 version /tmp/dci-pr36 --version /tmp/dci-pr36 --helpversionand--versionshould print the same local version without making a network request. Root help should retain the existing complete command behavior.Could this break things?
Risk: low. This only reserves
versionas a local command, matching the already-supported--versionbehavior. API commands, root help, unknown-command handling, and the embedded agent skill are unchanged. Only an unusual workflow that intentionally usedversionas an API host token would behave differently.